package cn.edu.zafu.bigdata.x.zhaobolei.Third;

interface Movable {
    void move();
    void stop();
}

interface Resizable {
    void resize(double factor);
}

class Car implements Movable {
    @Override
    public void move() {
        System.out.println("The car is moving.");
    }

    @Override
    public void stop() {
        System.out.println("The car has stopped.");
    }
}

class ResizableCircle implements Movable, Resizable {
    public double radius;

    // 构造函数
    public ResizableCircle(double radius) {
        this.radius = radius;
    }

    @Override
    public void move() {
        System.out.println("The circle is moving.");
    }

    @Override
    public void stop() {
        System.out.println("The circle has stopped.");
    }

    @Override
    public void resize(double factor) {
        radius += factor;
        System.out.println("The resized circle has a radius of: " + radius);
    }
}

public class TestInterface {
    public static void main(String[] args) {

        Car car = new Car();
        ResizableCircle circle = new ResizableCircle(25.0);


        car.move();
        car.stop();

        circle.move();
        circle.stop();
        circle.resize(4.0);
    }
}
